<?php

/***  DOCUMENTATION LAYER

Baffle Class Debugging Test

Last Update: Aug 2007
	
DESCRIPTION
	brief description of script here
	
NOTES
		
***/

$_tx0 = microtime();

// Test Name
$test_name = 'debug baffleclass';

// Include Files
require_once('baffle.m01.class.php');

// Variable Declarations
#$foo = 'bar';


// Script
if ( 1 )
{
  $Baffler = new Baffle($debug=1);
  $Baffler->print_d('<br /><br />testing referrer/seo', 'blue');
  $_REF[] = 'http://www.google.com/search?hl=en&q=testing+bafflegate&btnG=Google+Search';
  $_REF[] = 'http://search.yahoo.com/search?p=php+function+list&fr=yfp-t-471&toggle=1&cop=mss&ei=UTF-8';
  $_REF[] = 'http://www.ask.com/web?q=how+does+ask+encode+search+queries&search=search&qsrc=0&o=0&l=dir';
  $_pick = mt_rand(0,count($_REF)-1);
  $ref_url = $_REF[$_pick];
  $Baffler->print_d('setting referrer to: ' . $ref_url, 'magenta');
  $Baffler->referrer_url = $ref_url;
  $Baffler->referrer_domain = $Baffler->get_base_domain($Baffler->referrer_url);
  $Baffler->referrer_qstring = $Baffler->get_query_string($ref_url);
  $Baffler->referred_from_search = $Baffler->is_referred_by_seo();
  $Baffler->referring_keywords = $Baffler->get_search_keywords();
  $Baffler->print_d('keywords: ' . $Baffler->referring_keywords, 'purple');
  #$Baffler->dump();

  $Baffler->print_d('<br /><br />testing ->get_client_data()', 'green');
  $Baffler2 = new Baffle($debug=1);
  $Baffler2->get_client_data();
  $Baffler2->print_d('agent_os: ' . $Baffler2->agent_os);
  $Baffler2->select_account_data_by_domain($Baffler2->visiting_domain); 
  $Baffler2->dump();
  
  $Baffler->print_d('<br /><br />testing log.m04.php', 'magenta');
  require_once('log.m04.php');
}


// Footer
$_txn = microtime();
$stx = number_format(((substr($_txn,0,9)) + (substr($_txn,-10)) - (substr($_tx0,0,9)) - (substr($_tx0,-10))),4); 
echo "<h6>test '$test_name' complete in $stx s</h6>";

?>
